%  { 4. Byzantine Coins. These data are from a
% paper by Hendy and Charles (Archaeometry, 1970) and comprise the
%  silver content (\%Ag) of a number of Byzantine
%  coins discovered in Cyprus. The coins are from the first and fourth coinages
%   in the reign of
%  King Manuel I, Comnenus (1143--1180).
% \begin{center}
% \begin{tabular}{|l|ccccccccc|}
% \hline
% 1st coinage & 5.9 & 6.8 & 6.4 & 7.0 & 6.6 & 7.7 & 7.2 & 6.9 & 6.2 \\
% 4th coinage & 5.3 & 5.6 & 5.5 & 5.1 & 6.2 & 5.8 & 5.8 &     &     \\
% \hline
% \end{tabular}
% \end{center}
%      The question of interest is whether or not there
%      is statistical evidence to suggest that the silver content
%       of the coins was significantly different
%      in the later coinage.

clear all 
close all
%==========
 lw = 2;  
 set(0, 'DefaultAxesFontSize', 16);
 fs = 16;
 msize = 6;
%==========
coins=[5.9  6.8  6.4  7.0  6.6  7.7  7.2  6.9  6.2 ...
       5.3  5.6  5.5  5.1  6.2  5.8  5.8];
coins1=coins(1:9); coins2=coins(10:16);
%--------------------------------
t = (mean(coins1)-mean(coins2))/sqrt(var(coins1)+var(coins2))
  
 tps =[]; asl=0;
 N=10000;
 for i = 1:N
coinsp=coins(randperm(16));
coinsp1=coinsp(1:9); coinsp2=coinsp(10:16);
tp = (mean(coinsp1)-mean(coinsp2))/sqrt(var(coinsp1)+var(coinsp2));
tps = [tps tp ];
asl = asl + (abs(tp) > t );
 end
asl = asl/N

hist(tps, 50) 
hold on
plot([t t],[0,400],'k:','linewidth',5)
%
print -deps 'C:\NPBook\Bootstrap\permute1.eps'

